<?php
/**
 * Created by PhpStorm.
 * User: lg
 * Date: 2017/11/11
 * Time: 14:38
 */

namespace app\common\model;

use think\Model;

class Admin extends Model
{
    public function getUser($where = [])
    {
        $where['a.status'] = 1;
        return db('admin')
            ->alias('a')
            ->field('a.admin_id,a.username,r.role_name')
            ->join('__ADMIN_ROLE__ ar','a.admin_id = ar.admin_id','LEFT')
            ->join('__ROLE__ r','ar.role_id = r.role_id','LEFT')
            ->where($where)
            ->select();
    }
}